import json

import pytest
import requests

from basic.make_data import MakeFakerDate
from const import TOKEN_PATH
from step.step_marketing import Step as MarketingStep

mark = MarketingStep()
faker = MakeFakerDate()

@pytest.fixture(scope='session', autouse=True)
def login():
    data = {
        "url": 'http://124.70.39.201/adminapi/login',
        "params": {'username': 'admin', 'password': '123123', }
    }
    token = {"token": requests.get(**data).json()['data']['token']}
    with open(str(TOKEN_PATH), 'w') as f:
        json.dump(token, f)

def init_db():
    pass